/*
 * UPSpring.java
 *
 * Created on 2010-06-14, 23:49:12
 */

package JET.UtilPanels;

import JET.Centers.ControlCenter;
import JET.Centers.Graphics.GUICenter;
import JET.Scene;
import JET.StaticActions;
import JET.mygui.UtilTabsPane.UtilTabsPaneTab;
import java.awt.event.KeyEvent;

/**
 *
 * @author 057Ry
 */
public class UPSpring extends javax.swing.JPanel implements UtilTabsPaneTab {

    static final ControlCenter CC = ControlCenter.getInstance();

    double startLengthSliderMultiplier;
    private Scene scene;

    /** Creates new form UPSpring */
    public UPSpring() {
        initComponents();

        startLengthSliderMultiplier = Double.parseDouble((String)startLengthComboBox.getSelectedItem());

        setSpringsKsGUIValue(10.);
        setSpringsKdGUIValue(.5);
        setStartLengthGUIValue(50);
    }

    public void setScene(Scene s) {
        scene = s;
    }

    public GUICenter.UtilTabs getId() {
        return GUICenter.UtilTabs.Spring;
    }

    public boolean isScrollable() {
        return true;
    }

    private void setSpringsName() {
        String name = springsNameTextField.getText();
        StaticActions.setSelectedSpringsName(name, scene);
    }

    private void setSpringsKs() {
        double ks =0.;

        try {
            ks = getSpringsKsGUIValue();
        }catch(NumberFormatException nfe) {
            System.out.println("Cannot parse this value into double number format ...");
            return;
        }

        StaticActions.setSelectedSpringsKs(ks, scene);
    }

    private void setSpringsKd() {
        double kd = 0.;

        try {
            kd = getSpringsKdGUIValue();
        }catch(NumberFormatException nfe){
            System.out.println("Cannot parse this value into double number format ...");
            return;
        }

        StaticActions.setSelectedSpringsKd(kd, scene);
    }

    private void setSpringsKt() {
        double kt = 0.;

        try {
            kt = getSpringsKtGUIValue();
        }catch(NumberFormatException nfe){
            System.out.println("Cannot parse this value into double number format ...");
            return;
        }

        StaticActions.setSelectedSpringsKt(kt, scene);
    }

    public void setSpringsTearable(boolean value) {
        StaticActions.setSelectedSpringsTearable(value, scene);
    }
    public void setSpringsAlive(boolean value) {
        StaticActions.setSelectedSpringsAlive(value, scene);
    }

    private void setStartLength() {
        double startLength=0.;

        try {
            startLength = getStartLengthGUIValue();
        }catch(NumberFormatException nfe) {
            System.out.println("Cannot parse this value into double number format ...");
            return;
        }

        StaticActions.setSelectedSpringsStartLength(startLength, scene);
    }

    private void setStartLengthAsCurrent() {
        StaticActions.setSelectedSpringsStartLengthAsCurrent(startLengthSliderMultiplier, scene);
    }

    public String getSpringsNameGUIValue() {
        return springsNameTextField.getText();
    }

    public void setSpringsNameGUIValue(String value) {
        springsNameTextField.setName(value);
    }

    public double getSpringsKsGUIValue() {
        return Double.parseDouble( springsKsTextField.getText() );
    }

    public void setSpringsKsGUIValue(double ks) {
        springsKsSlider.setValue( (int)(ks*10) );
        springsKsTextField.setText(""+(ks));
    }

    public double getSpringsKdGUIValue() {
        return Double.parseDouble( springsKdTextField.getText() );
    }

    public void setSpringsKdGUIValue(double kd) {
        springsKdSlider.setValue( (int)(kd*10) );
        springsKdTextField.setText( ""+(kd));
    }

    public double getSpringsKtGUIValue() {
        return Double.parseDouble( springsKtTextField.getText() );
    }

    public void setSpringsKtGUIValue(double kt) {
        springsKtSlider.setValue( (int)(kt*10) );
        springsKtTextField.setText( ""+(kt));
    }

    public boolean getSpringsTearableGUIValue() {
        return tearableCheckBox.isSelected();
    }

    public void setSpringsTearableGUIValue(boolean value) {
        tearableCheckBox.setSelected(value);
    }

    public boolean getSpringsAliveGUIValue() {
        return aliveCheckBox.isSelected();
    }

    public void setSpringsAliveGUIValue(boolean value) {
        aliveCheckBox.setSelected(value);
    }

    public void setStartLengthGUIValue(double value) {
        startLengthSlider.setValue( (int)(value*startLengthSliderMultiplier) );
        startLengthTextField.setText(""+value);
    }

    public double getStartLengthGUIValue() {
        return Double.parseDouble( startLengthTextField.getText() );
    }

    public void setSpringsKsText(String text) {
        springsKsTextField.setText(text);
    }

    public void setSpringsKdText(String text) {
        springsKdTextField.setText(text);
    }

    public void setSpringsKtText(String text) {
        springsKtTextField.setText(text);
    }

    public void setStartLengthText(String text) {
        startLengthTextField.setText(text);
    }

    public void bringFocusToSpringsKsTextField() {
        springsKsTextField.requestFocus();
        springsKsTextField.select(0, springsKsTextField.getText().length());

    }

    public void bringFocusToSpringsKdTextField() {
        springsKdTextField.requestFocus();
        springsKdTextField.select(0, springsKdTextField.getText().length());
    }

    public void bringFocusToSpringsKtTextField() {
        springsKtTextField.requestFocus();
        springsKtTextField.select(0, springsKtTextField.getText().length());
    }

    public void bringFocusToStartLengthTextField() {
        startLengthTextField.requestFocus();
        startLengthTextField.select(0, startLengthTextField.getText().length());
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        springsKsTextField = new javax.swing.JTextField();
        springsKdTextField = new javax.swing.JTextField();
        springsKsSlider = new javax.swing.JSlider();
        springsKdSlider = new javax.swing.JSlider();
        jLabel4 = new javax.swing.JLabel();
        startLengthTextField = new javax.swing.JTextField();
        startLengthSlider = new javax.swing.JSlider();
        startLengthComboBox = new javax.swing.JComboBox();
        startLengthButton1 = new javax.swing.JButton();
        springsKtSlider = new javax.swing.JSlider();
        springsKtTextField = new javax.swing.JTextField();
        jLabel5 = new javax.swing.JLabel();
        tearableCheckBox = new javax.swing.JCheckBox();
        aliveCheckBox = new javax.swing.JCheckBox();
        jLabel1 = new javax.swing.JLabel();
        springsNameTextField = new javax.swing.JTextField();

        jLabel2.setText("Ks");

        jLabel3.setText("Kd");

        springsKsTextField.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        springsKsTextField.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                springsKsTextFieldKeyPressed(evt);
            }
        });

        springsKdTextField.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        springsKdTextField.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                springsKdTextFieldKeyPressed(evt);
            }
        });

        springsKsSlider.setMaximum(500);
        springsKsSlider.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                springsKsSliderStateChanged(evt);
            }
        });
        springsKsSlider.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
            public void mouseDragged(java.awt.event.MouseEvent evt) {
                springsKsSliderMouseDragged(evt);
            }
        });

        springsKdSlider.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                springsKdSliderStateChanged(evt);
            }
        });
        springsKdSlider.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
            public void mouseDragged(java.awt.event.MouseEvent evt) {
                springsKdSliderMouseDragged(evt);
            }
        });

        jLabel4.setText("Start Length");

        startLengthTextField.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        startLengthTextField.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                startLengthTextFieldActionPerformed(evt);
            }
        });
        startLengthTextField.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                startLengthTextFieldKeyPressed(evt);
            }
        });

        startLengthSlider.setMaximum(10000);
        startLengthSlider.setValue(0);
        startLengthSlider.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                startLengthSliderStateChanged(evt);
            }
        });
        startLengthSlider.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
            public void mouseDragged(java.awt.event.MouseEvent evt) {
                startLengthSliderMouseDragged(evt);
            }
        });

        startLengthComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "0.25", "0.5", "1", "5", "10", "50", "100", "500", "1000", "10000", " " }));
        startLengthComboBox.setSelectedIndex(6);
        startLengthComboBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                startLengthComboBoxActionPerformed(evt);
            }
        });

        startLengthButton1.setText("Recalculate Start Lengths");
        startLengthButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                startLengthButton1ActionPerformed(evt);
            }
        });

        springsKtSlider.setValue(30);
        springsKtSlider.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                springsKtSliderStateChanged(evt);
            }
        });
        springsKtSlider.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
            public void mouseDragged(java.awt.event.MouseEvent evt) {
                springsKtSliderMouseDragged(evt);
            }
        });

        springsKtTextField.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        springsKtTextField.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                springsKtTextFieldActionPerformed(evt);
            }
        });
        springsKtTextField.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                springsKtTextFieldKeyPressed(evt);
            }
        });

        jLabel5.setText("Kt");

        tearableCheckBox.setText("tearable");
        tearableCheckBox.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                tearableCheckBoxItemStateChanged(evt);
            }
        });
        tearableCheckBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tearableCheckBoxActionPerformed(evt);
            }
        });

        aliveCheckBox.setText("alive");
        aliveCheckBox.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                aliveCheckBoxItemStateChanged(evt);
            }
        });
        aliveCheckBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                aliveCheckBoxActionPerformed(evt);
            }
        });

        jLabel1.setText("Name:");

        springsNameTextField.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                springsNameTextFieldActionPerformed(evt);
            }
        });
        springsNameTextField.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                springsNameTextFieldKeyPressed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel4)
                    .addComponent(startLengthButton1, 0, 0, Short.MAX_VALUE)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addComponent(startLengthSlider, javax.swing.GroupLayout.DEFAULT_SIZE, 36, Short.MAX_VALUE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(startLengthComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(startLengthTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 97, Short.MAX_VALUE)
                    .addComponent(aliveCheckBox)
                    .addComponent(springsKsSlider, 0, 0, Short.MAX_VALUE)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLabel2)
                        .addGap(18, 18, 18)
                        .addComponent(springsKsTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 68, Short.MAX_VALUE))
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLabel3)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(springsKdTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 75, Short.MAX_VALUE))
                    .addComponent(springsKdSlider, 0, 0, Short.MAX_VALUE)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLabel5)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(springsKtTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 77, Short.MAX_VALUE))
                    .addComponent(springsKtSlider, 0, 0, Short.MAX_VALUE)
                    .addComponent(tearableCheckBox)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLabel1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(springsNameTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 62, Short.MAX_VALUE)))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(springsNameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(17, 17, 17)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(springsKsTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(1, 1, 1)
                .addComponent(springsKsSlider, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(8, 8, 8)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel3)
                    .addComponent(springsKdTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(springsKdSlider, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel5)
                    .addComponent(springsKtTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(springsKtSlider, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(tearableCheckBox)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(aliveCheckBox)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel4)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(startLengthTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(startLengthComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(startLengthSlider, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(40, 40, 40)
                .addComponent(startLengthButton1)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        getAccessibleContext().setAccessibleName("Spring propetries");
    }// </editor-fold>//GEN-END:initComponents

    private void springsKsSliderStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_springsKsSliderStateChanged
        springsKsTextField.setText( ""+springsKsSlider.getValue()*0.1 );
    }//GEN-LAST:event_springsKsSliderStateChanged

    private void springsKdSliderStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_springsKdSliderStateChanged
        springsKdTextField.setText( ""+springsKdSlider.getValue()*0.1 );
}//GEN-LAST:event_springsKdSliderStateChanged

    private void startLengthSliderStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_startLengthSliderStateChanged
        startLengthTextField.setText( ""+startLengthSlider.getValue()/startLengthSliderMultiplier );
}//GEN-LAST:event_startLengthSliderStateChanged

    private void startLengthComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_startLengthComboBoxActionPerformed
        startLengthSliderMultiplier = (double)startLengthSlider.getMaximum()/Double.parseDouble((String)startLengthComboBox.getSelectedItem());
        setStartLengthGUIValue( getStartLengthGUIValue() );
}//GEN-LAST:event_startLengthComboBoxActionPerformed

    private void startLengthButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_startLengthButton1ActionPerformed
        setStartLengthAsCurrent();
}//GEN-LAST:event_startLengthButton1ActionPerformed

    private void springsKsTextFieldKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_springsKsTextFieldKeyPressed
        switch(evt.getKeyCode()) {
            case KeyEvent.VK_ENTER :
                setSpringsKs();
                break;
        }
    }//GEN-LAST:event_springsKsTextFieldKeyPressed

    private void springsKdTextFieldKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_springsKdTextFieldKeyPressed
        switch(evt.getKeyCode()) {
            case KeyEvent.VK_ENTER :
                setSpringsKd();
                break;
        }
    }//GEN-LAST:event_springsKdTextFieldKeyPressed

    private void springsKtSliderStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_springsKtSliderStateChanged
        springsKtTextField.setText( ""+springsKtSlider.getValue()*0.1 );
    }//GEN-LAST:event_springsKtSliderStateChanged

    private void springsKtTextFieldKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_springsKtTextFieldKeyPressed
        switch(evt.getKeyCode()) {
            case KeyEvent.VK_ENTER :
                setSpringsKt();
                break;
        }
    }//GEN-LAST:event_springsKtTextFieldKeyPressed

    private void tearableCheckBoxItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_tearableCheckBoxItemStateChanged
        
    }//GEN-LAST:event_tearableCheckBoxItemStateChanged

    private void aliveCheckBoxItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_aliveCheckBoxItemStateChanged
        
    }//GEN-LAST:event_aliveCheckBoxItemStateChanged

    private void springsNameTextFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_springsNameTextFieldActionPerformed
        setSpringsName();
    }//GEN-LAST:event_springsNameTextFieldActionPerformed

    private void springsKtTextFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_springsKtTextFieldActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_springsKtTextFieldActionPerformed

    private void springsNameTextFieldKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_springsNameTextFieldKeyPressed
        switch(evt.getKeyCode()) {
            case KeyEvent.VK_ENTER :
                setSpringsName();
                break;
        }
    }//GEN-LAST:event_springsNameTextFieldKeyPressed

    private void startLengthTextFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_startLengthTextFieldActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_startLengthTextFieldActionPerformed

    private void startLengthTextFieldKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_startLengthTextFieldKeyPressed
        switch (evt.getKeyCode()) {
            case KeyEvent.VK_ENTER :
                setStartLength();
                break;
        }
    }//GEN-LAST:event_startLengthTextFieldKeyPressed

    private void springsKsSliderMouseDragged(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_springsKsSliderMouseDragged
        setSpringsKs();
    }//GEN-LAST:event_springsKsSliderMouseDragged

    private void springsKdSliderMouseDragged(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_springsKdSliderMouseDragged
        setSpringsKd();
    }//GEN-LAST:event_springsKdSliderMouseDragged

    private void springsKtSliderMouseDragged(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_springsKtSliderMouseDragged
        setSpringsKt();
    }//GEN-LAST:event_springsKtSliderMouseDragged

    private void tearableCheckBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tearableCheckBoxActionPerformed
        setSpringsTearable(tearableCheckBox.isSelected());
    }//GEN-LAST:event_tearableCheckBoxActionPerformed

    private void aliveCheckBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_aliveCheckBoxActionPerformed
        setSpringsAlive(aliveCheckBox.isSelected());
    }//GEN-LAST:event_aliveCheckBoxActionPerformed

    private void startLengthSliderMouseDragged(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_startLengthSliderMouseDragged
        setStartLength();
    }//GEN-LAST:event_startLengthSliderMouseDragged


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JCheckBox aliveCheckBox;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JSlider springsKdSlider;
    private javax.swing.JTextField springsKdTextField;
    private javax.swing.JSlider springsKsSlider;
    private javax.swing.JTextField springsKsTextField;
    private javax.swing.JSlider springsKtSlider;
    private javax.swing.JTextField springsKtTextField;
    private javax.swing.JTextField springsNameTextField;
    private javax.swing.JButton startLengthButton1;
    private javax.swing.JComboBox startLengthComboBox;
    private javax.swing.JSlider startLengthSlider;
    private javax.swing.JTextField startLengthTextField;
    private javax.swing.JCheckBox tearableCheckBox;
    // End of variables declaration//GEN-END:variables

}
